<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="s_product" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 盘存内容 </span>
      </div>
      <div>
        <input type="hidden" id="note_id" name="note_id" :value="s_product.note_id">
        <input type="hidden" id="product_id" name="product_id" :value="s_product.product_id">
        <input type="hidden" id="product_num" name="product_num" :value="s_product.product_num">
        <el-row>
          <el-col :span="24">
            <el-form-item label="产品条形码" prop="">
              {{s_product.product_barcode}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="产品名称" prop="">
              {{s_product.product_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="规格型号" prop="">
              {{s_product.product_model}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="产品区域" prop="">
              {{empty}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="累积数量" prop="">
              {{s_product.product_num}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="实际盘存数" prop="take_num">
              <el-input v-model="s_product.take_num" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="差异原因" prop="take_diff">
              <el-input v-model="s_product.take_diff" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="差异处理" prop="take_process">
              <el-input v-model="s_product.take_process" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存结论" prop="take_verdict">
              <el-input v-model="s_product.take_verdict" />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="inventoryUpDetSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'InventoryUpDet',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_product: {
          product_barcode: null,
          product_name: null,
          product_model: null,
          product_num: null,
          take_num: null,
          take_diff: null,
          take_process: null,
          take_verdict: null,
        },
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryUpDet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      inventoryUpDetSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryUpDetSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.$router.replace("/redirect" + this.$route.fullPath);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
